﻿Imports System.Text
Imports D2L.Extensibility.AuthSdk
Imports RestSharp
Imports D2L.Extensibility.AuthSdk.Restsharp

<TestClass()>
Public Class EnrollTeste

    Private _authObj As Authenticate.Authenticate = New Authenticate.Authenticate()
    Protected method As Authenticate.Service

    'http://docs.valence.desire2learn.com/res/enroll.html#Enrollment.ClasslistUser
    'http://docs.valence.desire2learn.com/res/enroll.html#get--d2l-api-le-(version)-(orgUnitId)-classlist-

    '--Erro 403
    <TestMethod()>
    Public Sub get_enroll()

        method = New Authenticate.Service

        Dim _response As RestSharp.IRestResponse(Of Enroll.ClasslistUser) = _authObj.ExecuteService_with_UserContext(method.GetEnroll, RestSharp.Method.GET, Type.ClasslistUser)

        Console.WriteLine("{0}{1}", "Response:", _response.ToString())
        Console.WriteLine("Response Content: {0}", _response.Content.ToString())

        Assert.IsNotNull(_response)
        Assert.AreEqual("OK", _response.StatusCode.ToString())

    End Sub

End Class
